//
//  ViewController1.m
//  TableSelectDemo
//
//  Created by ebeijia on 15/11/26.
//  Copyright © 2015年 ebeijia. All rights reserved.
//

#import "ViewController1.h"

@interface ViewController1 ()

@end

@implementation ViewController1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    
    
    CGFloat floata = 12.07;
    CGFloat floatb = 12;
    CGFloat floatc = 12.8;
    CGFloat floatd = 12.08;
    CGFloat floate = 12.82;
    CGFloat floatf = 12.056;
    floata = floor(floata * 100) / 100;
    floatb = floor(floatb * 100) / 100;
    floatc = floor(floatc * 100) / 100;
    floatd = floor(floatd * 100) / 100;
    floate = floor(floate * 100) / 100;
    floatf = floor(floatf * 100) / 100;
    NSLog(@" a= %f          b= %f         c= %f          d= %f          e= %f        f= %f",floata,floatb,floatc,floatd,floate,floatf);
    
    NSLog(@"a= %.2f          b= %.2f         c= %.2f          d= %.2f          e= %.2f        f= %.2f",floata,floatb,floatc,floatd,floate,floatf);
    
    
    NSString *a = @"12";
    NSString *b = @"12.68";
    NSString *c = @"12.54";
    
    CGFloat a1 = [a floatValue];
    CGFloat b1 = [b floatValue];
    CGFloat c1 = [c floatValue];
    
    NSLog(@"a %.2f   b %.2f   c %.2f",a1,b1,c1);
    
    
    [self.delegate viewDelegate];
    
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(10,100, 200, 100);
    [button addTarget:self action:@selector(buttonclick) forControlEvents:UIControlEventTouchUpInside];
    button.backgroundColor = [UIColor redColor];
    [self.view addSubview:button];
    
    UILabel *label = [[UILabel alloc] initWithFrame:button.bounds];
    label.backgroundColor = [UIColor blackColor];
    [button addSubview:label];
    
}

- (void)buttonclick
{
    NSLog(@"可以");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
